package webcomponents;

import java.util.List;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Select;

public class showOptions {

	WebDriver driver;
	String baseUrl;

	public static void main(String[] args) {
		
		// Define a driver for the page and navigate to the website
		
		WebDriver driver = new FirefoxDriver();
		String baseUrl="http://www.seek.com.au";
		driver.get(baseUrl);
		
		// Initiate seek.com.au homepage
		
		dropdownMenu homePage = PageFactory.initElements(driver, dropdownMenu.class);
		
		// Initiate classification dropdown menu
		
		Select classificationDropdown = new Select(homePage.classifications);
		
		// Initiate the options in the dropdown menu as a list of webelements
		
		List <WebElement> options = classificationDropdown.getOptions();
		
		// Print out all options in the dropdown menu
		
		for(WebElement option : options)
		{
			System.out.println(option.getText());
		}

	}

}
